import sys
import time
from this import d

from page_object.main_page import GuangMainPage
from resource.contact import *
from resource.path_info import *


class TestIntoGuangBusiness:

    # def setup_class(self):
    #
    #     self.main = GuangMainPage()
        # self.main.intoGuang(self.main.d)

    def test_open_app(self):
        print()
        s = "神秘价：?.05"
        a = s[0:3]
        print()
        设置flagflag = False  # 用于控制外层循环的标志




        if self.main.d.xpath(
                '//*[@resource-id="com.youzan.guang.business:id/rvBindRecord"]/android.view.ViewGroup[1]/android.widget.TextView[1][contains(@text, "爱逛STUDIO-91186123")]').exists:
            print()
        strClassName = self.__class__.__name__
        strMethodName = sys._getframe().f_code.co_name
        self.main.d.xpath(goodsTitle_xpath %1).get_text()
        print("aaa")
        s = self.main.d.xpath('//*[@resource-id="com.youzan.guang.business:id/recycleView"]/android.view.ViewGroup[1]/android.widget.TextView').get_text()[8:]
        if self.main.d.xpath('//*[@resource-id="com.youzan.guang.business:id/recycleView"]/android.view.ViewGroup[1]/android.widget.CheckBox[1]').info['enabled']:

            s = self.main.d.xpath('//*[@resource-id="com.youzan.guang.business:id/goodsRv"]/android.view.ViewGroup[%d]/android.widget.TextView').get_text()[8:]
            print(s)


